package com.mjf.ys.enums;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * desc
 * </p>
 *
 * @author chenshoumeng
 * @date 2025/6/8 00:05
 */
@Getter
public enum YSApiEnum {

    YS_API_SALE_DELIVERY_SYNC_URL("401", "销售单同步接口地址", "/yonbip/sd/voucherorder/singleSave"),
    YS_API_STOCK_DELIVERY_SYNC_URL("402", "转库单同步接口地址", "/yonbip/scm/storetransfer/save"),
    YS_API_GOODS_DETAIL_URL("403", "获取商品详情接口地址", "/yonbip/digitalModel/goodsproductskupro/detail"),
    YS_API_SALE_RETURN_SYNC_URL("404", "销售退货单个保存接口地址", "/yonbip/sd/vouchersalereturn/singleSave"),
    YS_API_TRANSFER_ORDER_SYNC_URL("405", "调拨订单保存接口地址", "/yonbip/scm/transferapply/save"),
    YS_API_GOODS_DETAIL_LIST_URL("406", "获取商品信息接口地址", "/yonbip/digitalModel/goodsproductskupro/list"),
    YS_API_MATERIAL_CLASS_TREE_URL("407", "获取物料分类树接口地址", "/yonbip/digitalModel/managementclass/newtree"),
    YS_API_DYNAMIC_DOMAIN_URL("408", "获取动态域名接口地址", "/open-auth/dataCenter/getGatewayAddress?tenantId="),
    YS_API_GET_ACCESS_TOKEN_URL("409", "获取access_token接口地址", "/open-auth/selfAppAuth/getAccessToken"),
    YS_API_GET_STAFF_INFO_URL("410", "查询租户员工信息接口地址", "/yonbip/hrcloud/getStaffInfo"),
    YS_API_GET_STAFF_LIST_URL("411", "查询员工列表接口地址", "/yonbip/digitalModel/staff/list"),
    YS_API_SALE_DELIVERY_LIST_URL("412", "销售出库列表查询", "/yonbip/scm/salesout/list"),
    YS_API_SALE_DELIVERY_DETAIL_URL("413", "销售出库单详情查询", "/yonbip/scm/salesout/detail"),
    YS_API_AUXILIARY_BALANCE_QUERY_URL("414", "科目辅助全景查询", "/yonbip/fi/api/report/allAuxiliaryBalanceQuery"),
    ;

    private static final Map<String, YSApiEnum> LOOKUP_MAP = new HashMap<>(4, 1);

    static {
        for (YSApiEnum cstEnum : YSApiEnum.values()) {
            LOOKUP_MAP.put(cstEnum.codes, cstEnum);
        }
    }

    YSApiEnum(String codes, String name, String url) {
        this.codes = codes;
        this.name = name;
        this.url = url;
    }

    /**
     * -- GETTER --
     *
     * @return 枚举值
     */
    private String codes;
    private String name;
    private String url;



    /**
     * 根据枚举值获取枚举
     *
     * @param codes codes
     * @return 若枚举值存在，返回对应的枚举，否则返回 null
     */
    public static YSApiEnum formValue(String codes) {
        return LOOKUP_MAP.get(codes);
    }

    @Override
    public String toString() {
        return "YSApiEnum{" +
            "codes='" + codes + '\'' +
            ", name='" + name + '\'' +
            ", url='" + url + '\'' +
            '}';
    }
}
